#@datagrid()
#define content_header()
<h1>
    <a href="/middleman">居间商管理</a>
    <small>agency tables</small>
</h1>
<ol class="breadcrumb">
    <li><a href="#"><i class="fa fa-dashboard"></i> 首页</a></li>
    <li><a href="/agency/">代理</a></li>
    <li class="active">居间商管理</li>
</ol>
#end
<!-- 账户明细 -->
#define content()
<div class="box">
    <div class="box-header">

        <!-- 个人信息 -->
        #include("_agencyinfopart.html")

        <!-- 选项卡 -->
        #if(user_type == 'c')
        #set(tabid="tabtransaction_detailc")
        #else
        #set(tabid="tabtransaction_detail")
        #end
        #include("_subpage_navtabs.html")
        <!-- search -->
        #set(formaction="transaction_detail")
        #include("_searchform.html")
    </div>
    <!-- /.box-header -->
    <div class="box-body">
        <table class="xsui-datagrid table table-condensed table-bordered table-striped table-hover">
            <thead>
                <tr>
                    <th>#</th>
                    <th>交易流水号</th>
                    <th>用户ID</th>
                    <th>用户昵称</th>
                    <th>交易单号</th>
                    <th>交易金额</th>
                    <th>交易类型</th>
                    <th>支付渠道</th>
                    <th>账户余额</th>
                    <th>流水说明</th>
                    <th>第三方渠道充值单号</th>
                    <th>操作员</th>
                    <th>交易时间</th>
                </tr>
            </thead>
            <tbody>
                #for(x : listPage.getList())
                <tr data-key="#(x.id)">
                    <td class="xsui-rowid"></td>
                    <td>#(x.id)</td>
                    <td>#(x.user_id)</td>
                    <td>#(x.nickname)</td>
                    <td>#(x.serial_no)</td>
                    <td>#(x.amount)</td>
                    <td class="xsui-cell-tradetype">#(x.tradeTypeText)</td>
                    <td>#(x.pay_channel)</td>
                    <td>#(x.blance)</td>
                    <td>#(x.remark)</td>
                    <td>#(x.out_trade_no)</td>
                    <td>#(x.auditor_id)</td>
                    <td>#(x.createTimeText??)</td>
                </tr>
                #end
            </tbody>
        </table>
        <!--分页条-->
        #include("_pagination.html")
    </div>
    <!-- /.box-body -->
</div>
<!-- /.box -->
#end
#define body_foot()
<script type="text/javascript">
    $('.xsui-cell-tradetype').each(function () {
        var $cell = $(this);
        console.log($cell.text());
        switch ($cell.text()) {
            case "充值":
                $cell.addClass("text-success");
                break;
            case "提现":
                $cell.addClass("text-danger");
                break;
            case "返现":
                $cell.addClass("text-blue");
                break;
        }
    })
</script>
#end